package org.example.springmvcdemo.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.springmvcdemo.model.MessageInfo;

import java.util.List;

@Mapper
public interface MessageInfoMapper {
    //发表留言
    @Insert("insert into message_info (`from`,`to`,`say`) values(#{from},#{to},#{say})")
    Integer insert(MessageInfo messageInfo);
    //获取留言
    @Select("select * from message_info where delete_flag=0 ")
    List<MessageInfo> selectAll();
}
